-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use custom traits instead of libstd's MetadataExt
and PermissionsExt
.
#343
Conversation
…xt`. Define our own copy of `MetadataExt` and `PermissionsExt` and change the code to use them instead of `std::os::*::fs::MetadataExt` and `std::os::*::fs::PermissionsExt'. In general, we should be moving away from using std's `Ext` traits like this, as they weren't meant to be used in this way. Fixes #342.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sane to me
fn blksize(&self) -> u64; | ||
/// Returns the number of blocks allocated to the file, in 512-byte units. | ||
fn blocks(&self) -> u64; | ||
#[cfg(target_os = "vxworks")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems easy for us to somehow miss future extensions to these traits in std, especially slightly more obscure OSes. This seems to be the main downside of this. But eh, in the end if there's some obscure new API and we don't notice, it can just be added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. All of cap-std already faces this challenge; it's just the nature of what cap-std being what it is.
Remove more uses of the std::os traits, and update the build.rs scripts to fix Rust feature detection.
Adapt to the changes in that crate, xref bytecodealliance/cap-std#343
Define our own copy of
MetadataExt
andPermissionsExt
and change the code to use them instead ofstd::os::*::fs::MetadataExt
and `std::os::*::fs::PermissionsExt'.In general, we should be moving away from using std's
Ext
traits like this, as they weren't meant to be used in this way.Fixes #342.